package com.lc.pianostudent.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2018/2/22.
 */
@HttpInlet(Conn.ANSWER_INDEX)
public class PostAnswerIndex extends BaseAsyPost {

    public String user_id;
    public PostAnswerIndex(AsyCallBack asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected PostAnswerIndexInfo parser(JSONObject object) throws Exception {
//        if (object.optString("code").equals("200")) {

            PostAnswerIndexInfo info = new PostAnswerIndexInfo();

            info.code = object.optString("code");
            info.message = object.optString("message");
            JSONObject jsonObject = object.optJSONObject("data");
            info.degree = jsonObject.optString("degree");
            info.xuewei = jsonObject.optString("xuewei");

            JSONObject jsonObject1 = object.optJSONObject("number");
            info.number = jsonObject1.optString("number");
            info.teacherid = jsonObject1.optString("teacherid");
            info.type = jsonObject1.optString("type");

            TOAST = object.optString("message");
            return info;

//        } else {
//
//            TOAST = object.optString("message");
//
//        }return null;
    }

    public static class PostAnswerIndexInfo {

        public String code, message,degree,xuewei,number,teacherid,type;

    }

}
